package cn.xz.zysjz.adapter;

import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import cn.xz.zysjz.R;
import cn.xz.zysjz.bean.HomeListBean;
import cn.xz.zysjz.utils.AppHelper;

public class HomeListAdapter extends BaseQuickAdapter<HomeListBean, BaseViewHolder> {

    public HomeListAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, HomeListBean mListBean) {
        //图片
        ImageView mPic = helper.getView(R.id.iv_pic);
        //文本
        TextView mTxt = helper.getView(R.id.tv_txt);

        //设置图片
        AppHelper.setLocalPic(mPic,mListBean.getUrl());
        //设置文本
        mTxt.setText(mListBean.getMsg());
    }
}
